package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name     string `gorm:"type:varchar(30);not null"`
	Mobile   string `gorm:"type:varchar(11);not null"`
	Password string `gorm:"type:varchar(32);not null"`
}

type GoodHome struct {
	gorm.Model
	Name    string `gorm:"type:varchar(30);not null"`
	Status  string `gorm:"type:varchar(30);not null"`
	Image   string `gorm:"type:varchar(500);not null"`
	Address string `gorm:"type:varchar(100);not null"`
	Info    string `gorm:"type:varchar(100);not null"`
}

type Good struct {
	gorm.Model
	Name     string  `gorm:"type:varchar(30);not null"`
	Image    string  `gorm:"type:varchar(500);not null"`
	Price    float64 `gorm:"type:decimal(10,2);not null"`
	OldPrice float64 `gorm:"type:decimal(10,2);not null"`
	Info     string  `gorm:"type:varchar(100);not null"`
}

type GoodCar struct {
	gorm.Model
	GoodHomeId   int     `gorm:"type:int;not null"`
	GoodId       int     `gorm:"type:int;not null"`
	GoodHomeName string  `gorm:"type:varchar(30);not null"`
	GoodName     string  `gorm:"type:varchar(30);not null"`
	Num          int     `gorm:"type:int;not null"`
	Price        float64 `gorm:"type:decimal(10,2);not null"`
}

type Order struct {
	gorm.Model
	UserName     string  `gorm:"type:varchar(30);not null"`
	UserMobile   string  `gorm:"type:varchar(11);not null"`
	Address      string  `gorm:"type:varchar(100);not null"`
	GoodHomeName string  `gorm:"type:varchar(30);not null"`
	GoodName     string  `gorm:"type:varchar(30);not null"`
	Num          int     `gorm:"type:int;not null"`
	Info         string  `gorm:"type:varchar(30);not null"`
	Price        float64 `gorm:"type:decimal(10,2);not null"`
}
